package edu.kjxy.demo0315;

import java.util.Scanner;

public class demo01 {

	public static void main(String[] args) {
		System.out.println("请输入一个大于0的整数：");
		Scanner in = new Scanner(System.in);
		int i = 2;
		int n = in.nextInt();
		in.close();
		if(n < 1) {
			System.out.println("输入错误！");
			return;
		}
		while(i < n) {
			if(n % i == 0) {
				break;
			}
			i++;
		}
		if(i == n) {
			System.out.println(n + "是质数");
		}
		else {
			System.out.println(n + "不是质数");
		}
	}

}
